JSDoc generated v2 reference docs#1481
Conversation
Co-authored-by: Copilot <copilot@github.com>
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Solid 2.0 reference docs — categorization passRe: solid-docs PR #1481. The auto-generation script visits every public export and emits a page per symbol. That correctly captures the tarball's export surface, but the export surface is wider than the user-facing API — it also includes:
Categorization below is the disposition I'd recommend per export. Three buckets:
Recommended category splitSix top-level reference categories + one collapsible "Advanced". Maps to the structure of the canonical The PR's current split ( Per-export dispositionCanonical reference pages (full doc, primary nav)Reactivity
Stores
Lifecycle & Actions
Components & Context
Components (JSX)
Rendering & SSR
Advanced (full page, collapsed group)This bucket aligns with the "Advanced / escape hatches" section of Owner & introspection
Specialized reactivity & tracking
Store advanced
JSX component primitives The function/primitive forms underlying the canonical JSX components. App code uses the JSX form; the primitives exist for library authors, custom universal renderers, and programmatic composition.
Manual hydration
Interop & async
Diagnostics & dev hooks
Hidden (no page)Internal symbols / brands — pure cross-package wiring, never user-called:
Compiler-emitted, never user-called — every page generated for these is misleading because hand-written code doesn't reach for them:
Internal coordination — public for cross-package, not for users:
Document inline on the consuming API page (no standalone page)Mostly types (interfaces / type aliases) that exist purely to type a parameter, option bag, or return value of an API; one runtime helper (
Standalone Types pages worth keeping (they're cross-cutting structural types):
Disposition for the PR's
|
_unmapped/ page in PR |
Disposition |
|---|---|
create-error-boundary |
Advanced → JSX component primitives (paired with <Errored>) |
create-loading-boundary |
Advanced → JSX component primitives (paired with <Loading>) |
create-reveal-order |
Advanced → JSX component primitives (paired with <Reveal>) |
create-owner |
Hidden — framework-internal primitive for grouping cleanups. The user-facing entry points are createRoot (host a reactive scope outside a component) and runWithOwner (re-enter a captured owner). |
enable-external-source |
Advanced → Interop & async |
flatten |
Advanced → Interop & async (or hide; children() covers the common case) |
get-context |
Hidden — @solidjs/signals low-level primitive that useContext wraps. The canonical user-facing API is useContext (in solid-js). |
set-context |
Hidden — @solidjs/signals low-level primitive that createContext's provider wraps. The canonical user-facing API is createContext (in solid-js). |
hydration (the <Hydration> component) |
Advanced → Manual hydration |
is-disposed |
Advanced → Owner & introspection |
merge-props |
Hidden — @solidjs/web mergeProps is the dom-expressions compiler helper for prop spreads emitted by the JSX transform; not user-facing. Users call merge (in solid-js) directly. |
projection-options |
Fold into createProjection |
refreshable |
Fold into createOptimisticStore (with cross-links) |
store-options |
Fold into createStore |
store-setter |
Fold into createStore |
Cross-cutting recommendations
-
The export-surface ≠ doc-surface. A non-trivial slice of public exports is compiler-emitted or internal-coordination. The Hidden-bucket exports listed above are tagged
@internalin source — covering thessr*/ DOM-op compiler primitives in@solidjs/web/server-mock, themergePropsre-export, the brand symbols ($PROXY,$REFRESH,$TRACK,$TARGET,$DELETED,$DEVCOMP), the cross-package wiring (getContext/setContextfrom signals,createOwner,getNextChildId/peekNextChildId,enforceLoadingBoundary,sharedConfig,enableHydration,NoHydrateContext), and thessrHandleError/ssrRunInScopestubs. The doc-generator script can drive its hidelist off that JSDoc tag — keeps ROUTES focused on what should render, and the convention lives next to the export so adding a new internal symbol doesn't silently land a docs page. -
Type pages should default to inlined. A standalone
store-setterpage with a 3-line type alias is worse than the same content under the "Types" section ofcreateStore, where it's read in context. Suggest the script have a "fold into" mapping for type aliases:{ StoreSetter: "createStore", … }. -
secondary-primitives/should split.onSettledis canonical (and the canonical 2.0 lifecycle primitive — see point 4). The rest of the currentsecondary-primitives/set —createRoot,createRenderEffect,createReaction,createTrackedEffect,onCleanup,resolve— are all advanced. The "secondary" framing is a 1.x carry-over from whencreateMemo/createSignalwere "primary"; in 2.0 the right split is canonical-vs-advanced, not primary-vs-secondary. -
onCleanuppage warning. It's still public and supported, but the canonical 2.0 lifecycle isonSettledreturning a cleanup. The page should open with a callout to that effect (matches the JSDoc that ships ononCleanup/onSettledin@solidjs/signals). Otherwise readers will keep usingonCleanupfor component cleanup out of React-useEffectmuscle memory and miss thatonSettledis the better default. -
@solidjs/web-vs-solid-jsseparation.Portal,Dynamic,render,hydrate,isServer,isDev, and the SSRrenderTo*family are all on@solidjs/web. The reference pages can stay co-located, but the import path in each example should match — the auto-generator likely needs a per-symbol package map to renderimport { … } from "@solidjs/web"vs"solid-js"correctly.
JSDoc example coverage
Every Canonical and Advanced symbol enumerated above has an @example block in source. Examples use the @example tag uniformly across the surface — the JSX components (<For>, <Repeat>, <Switch>, <Errored>, <Reveal>, dynamic() / <Dynamic>) and the @solidjs/web build-time constants (isServer, isDev) are aligned with the rest. The doc generator can extract examples by walking @example tags only and produce uniform snippet rendering.
Forward-looking maintenance. Have the doc-generator script (or a preflight check in CI) fail when a page is emitted for a non-@internal Canonical/Advanced symbol whose JSDoc lacks an @example. That keeps the coverage from regressing as the surface evolves and surfaces missing examples at PR review time rather than at docs-publish time.
No description provided.